package OpenAccAve;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public  class OpenAccMapper extends Mapper<Object , Text, Text , IntWritable> {

    private static Text newKey=new Text();

    public void map(Object key,Text value,Context context) throws IOException, InterruptedException{
        //将输入的纯文本文件数据转化成string
        String[] splits = value.toString().split(",");
        String newKey=splits[5];

        int click=Integer.parseInt(splits[20]);
        //将数据和值输入到reduce处理

        context.write(new Text(newKey), new IntWritable(click));

    }
}